home *** CD-ROM | disk | FTP | other *** search
- /* strpbrk.c From TC Bible page 295 Use strpbrk to locate the first
- occurrence of any of the characters from one string in another string */
-
- #include <stdio.h>
- #include <string.h>
- char *vowels = "aeiou";
- main()
- {
- char str1[80], *result;
- printf("Enter a word: ");
- gets(str1);
- if ((result = strpbrk(str1, vowels)) == NULL)
- {
- printf("No vowels in word\n");
- }
- else
- {
- printf("First syllable in %s", str1);
- result++; /* Put a null character just after the first vowel */
- *result = '\0';
- printf("is: %s\n", str1);
- }
-
-
-
-
-
-
- }